#ifndef JAVASCRIPTINTERPRETER_H
#define JAVASCRIPTINTERPRETER_H

#include "script/Interpreter.h"

#include <v8.h>

using namespace v8;

#define JS_MSG 		"v8 JavaScript engine by Google"
#define JS_PROMPT  	">"
#define JS_PROMPT2 	">>"

class JavaScriptInterpreter : public Interpreter
{

public:
//	JavaScriptInterpreter(Persistent<Context> ctx);
	JavaScriptInterpreter();
	~JavaScriptInterpreter();

public:
	virtual void clearOutput() 		{ mOutput.clear(); }	
	virtual std::string getOutput() { return mOutput; }
	virtual std::string getPrompt() { return mPrompt; }
	virtual void insertLine(std::string&);


	Handle<ObjectTemplate> mGlobal;
	Persistent<Context> mContext;
	
protected:
	std::string mOutput;
	std::string mPrompt;

};

#endif // JAVASCRIPTINTERPRETER_H
